include '%finc%\libs\msgutils.inc'
include '%finc%\libs\strlib.inc'
include '%finc%\libs\giflib.inc'
include '%finc%\libs\gui.inc'
;include '%finc%\libs\winalign.inc'
include '%finc%\libs\tform.inc'
;include '%finc%\libs\forms.inc'
include '%finc%\libs\application.inc'
include '%finc%\libs\templates.inc'

include '%finc%\libs\msgutils.asm'
include '%finc%\libs\strlib.asm'
include '%finc%\libs\giflib.asm'
include '%finc%\libs\gui.asm'
;include '%finc%\libs\winalign.asm'
include '%finc%\libs\tform.asm'
;include '%finc%\libs\forms.asm'
include '%finc%\libs\application.asm'
include '%finc%\libs\templates.asm'


proc InitProgram .frmMainForm, .AppTitle
; Main init sequence
	invoke	GetModuleHandle,0
	mov	[hInstance],eax
	invoke	GetProcessHeap
	mov	[hHeap], eax

	call	InitStrings

; Registering classes
	call	RegisterApplicationClass
	call	RegisterFormClass

; Init common controls library
	invoke	InitCommonControls

; Startup windows creation
	stdcall InitApplication, 1,  [.AppTitle]
	invoke	CreateAcceleratorTable,MainAccels, [MainAccels.Count]
	invoke	SendMessage, [hApplication], AM_SETPARAM, TApplication.hAccelerators, eax

	stdcall CreateForm, [.frmMainForm], [hApplication]

	invoke	SendMessage, [hApplication], AM_SETPARAM, TApplication.hMainForm, ebx
	invoke	SendMessage, [hApplication], AM_SETPARAM, TApplication.OnIdle, OnIdleApplication

	ret
endp